import { defHttp } from "@/utils/http";

// ERP 销售率类别组 VO
export interface SrCatGrpVO {
	groupId: number; // 主键,示例值(16472)
	groupName: string; // 名称,示例值(李四)
	fundingId: number; // 组,示例值(21597)
	sqNumb: number; // 顺序
}

// ERP 销售率类别组 API
export const SrCatGrpApi = {
	// 查询销售率类别组分页
	getSrCatGrpPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/rate-category-config/page`, params });
	},

	// 查询销售率类别组详情
	getSrCatGrp: async (id: number) => {
		return await defHttp.get({ url: `/whs/rate-category-config/get?id=` + id });
	},

	// 新增销售率类别组
	createSrCatGrp: async (data: SrCatGrpVO) => {
		return await defHttp.post({ url: `/whs/rate-category-config/create`, data });
	},

	// 修改销售率类别组
	updateSrCatGrp: async (data: SrCatGrpVO) => {
		return await defHttp.put({ url: `/whs/rate-category-config/update`, data });
	},

	// 删除销售率类别组
	deleteSrCatGrp: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/rate-category-config/delete?id=` + id
		});
	},

	// 导出销售率类别组 Excel
	exportSrCatGrp: async (params: any) => {
		return await defHttp.download({ url: `/whs/rate-category-config/export-excel`, params });
	}
};
